package com.hhl.test;

import com.alibaba.fastjson.JSONObject;
import com.hhl.menu.*;
import com.hhl.util.HttpRequestUtil;
import com.hhl.util.WXURLUtil;
import com.hhl.util.WechatAccessToken;


/**
 * 大坪病案打印
 * 说明：<br>
 * <h1>创 建 人: hehailong   <br></h1>
 * 创建日期: 2017-11-13 下午4:43:51<br>
 * 需要的jar包:
 */
public class menutest3 {

	public static void main(String[] args) {

		ViewButton webSetApp2 = new ViewButton();
		webSetApp2.setName("病历查询");
		webSetApp2.setType("view");
		webSetApp2.setUrl("http://dpba.ophiux.com:8917/hospwechatmvc/medical-record/query-view");


		ViewButton webSetApp3 = new ViewButton();
		webSetApp3.setName("病历复印");
		webSetApp3.setType("view");
		webSetApp3.setUrl("http://dpba.ophiux.com:8917/hospwechatmvc/home/authorization");


		ViewButton webSetApp4 = new ViewButton();
		webSetApp4.setName("服务须知");
		webSetApp4.setType("view");
		webSetApp4.setUrl("http://dpba.ophiux.com:8917/hospwechatmvc/guidelines/guidelines-view");




		Menu menu = new Menu();
		menu.setButton(new BaseButton[]{webSetApp2,webSetApp3,webSetApp4});

		String btnJson = JSONObject.toJSONString(menu);

		System.out.println(btnJson);


		String token = "61_mMX_gEDl1nbhcwJu_CgBZmhirSxus9V_GgZEwemihrqf2SUGtY-ELOEsw-FQryiZQ98SDG64JWzMqqMmHcCjupLXviSIWATHRCcdZCQ45KsTHlnA0TG41nXfZKhRNfSLqtpx1Dr_wnwael2hYJTaAFAUFP";
		String param = "{\"button\":[{\"key\":\"2\",\"url\":\"http://mp.weixin.qq.com\",\"name\":\"进入小程序\",\"type\":\"miniprogram\",\"appId\":\"wx4a2fa2be1de1e3a3\",\"appid\":\"wx3a1ade37f99db9a5\",\"pagepath\":\"pages/index/index\"}]}";

		JSONObject bbb = HttpRequestUtil.httpRequest(WXURLUtil.MENU_URL.replace("ACCESS_TOKEN", token), "POST", param);
		System.out.println(JSONObject.toJSONString(bbb));

	}
	
}
